package com.itheima.thread;

public class Demo04 {

    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            String name = Thread.currentThread().getName();
            for (int i = 0; i < 100; i++) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(name+"正在执行 "+i);
            }

        });
        t1.setName("佩奇");
        t1.start();

        for (int i = 0; i < 100; i++) {
            System.out.println("main执行到了"+i);
        }
    }
}
